"Us" and "them" preceded nationalism by several thousand years.
I have heard this explained as being the result of how the human species originally evolved in small groups, which (to me, at least!) seems feasible. The "Us" and "Them" attitude is still very much alive and well; one only has to look at sports teams - and, perhaps even more significantly - their supporters to see evidence of this.
One achievement of nationalism was to at least lift this "Us" and "Them" tendency from out of the parochial level.
(Others here have correctly also identified what has sometimes been termed "ultra-nationalism", and which is one of the building blocks of Fascism).